<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>{$site_title}</title>
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="stylesheet" type="text/css" href="http://apps.bdimg.com/libs/blendui/2.0.0/boost.min.css" />
  <link rel="stylesheet" type="text/css" href="{$resource_basic}/css/webapp.css" />
  <script type="text/javascript" src="{$resource_basic}/js/jquery.min.js"></script>
  <script type="text/javascript" src="http://apps.bdimg.com/libs/blendui/2.0.0/boost.min.js"></script>
  <script type="text/javascript">
    window.boost = $.noConflict(true);
    </script>
<style type="text/css">
body{ background-color: #fff;}
.blend-fixedBar{height: auto;}
.blend-imglist-small a img{width:4.5rem; height:4.5rem; border-radius: 100%;}
.blend-imglist-small a p{ margin-top:-10px; font-size: 1.4rem;}
a{ color: #8A8A8A;}
a:hover{ color:#8A8A8A;}
.blend-title span{ color: #00B0FC; font-size: 1.6rem;}
.blend-card-sub-title{ margin-top:10px;}
.vote_btn{border-radius: 24px; background-color: #FF617B; border: none; color: #fff; width: 6rem;}
.blend-vote{ position: absolute; top:1rem; right: 1rem; top:2rem;}
.explain p{ font-size: 1.6rem; margin-left: 5%;}

.file_input{
    height: 46px;
    background-color: #fff;
    background-image: url(/Public/template/default/img/acsuzhou/school_add.png);
    background-size: 100%;
    width: 46px;
    text-indent: -1000px;
    margin: 1rem;
}

#submit_btn{
    width: 30%;
    border: none;
    border-radius: 10px;
    -webkit-user-select: text;
    background-color: rgb(0, 176, 254);
    float: right;
    margin-right: 3rem;
}

#reset_btn{
    width: 30%;
    border: none;
    border-radius: 10px;
    -webkit-user-select: text;
    background-color: rgb(204, 204, 204);
    float: left;
    margin-left: 3rem;
}

</style>
  
</head>

<body>
<div>  
    <div data-blend-widget="fixedBar" class="blend-fixedBar blend-fixedBar-top" style=' background-color: #fff;z-index: 1000;border-bottom: 1px solid #dcdcdc;'>
        <div class="blend-imglist" id="imglist1">
            <ul class="blend-imglist-wrapper blend-imglist-theme">
                <li class="blend-imglist-item blend-imglist-small">
                    <a href="{:U('M/Acsuzhou/like_product_list_app',array('mid' => $mid))}">
                        <img src="__PUBLIC__/template/default/img/acsuzhoulike/menu1-f.png">
                        <p>投票列表</p>
                    </a>
                </li>
                <li class="blend-imglist-item blend-imglist-small">
                    <a href="{:U('M/Acsuzhou/like_product_success_list_app',array('mid' => $mid))}">
                        <img src="__PUBLIC__/template/default/img/acsuzhoulike/menu2-f.png">
                        <p>送检产品</p>
                    </a>
                </li>
                <li class="blend-imglist-item blend-imglist-small">
                    <a href="{:U('M/Acsuzhou/like_product_diy_submit_app',array('mid' => $mid))}">
                        <img src="__PUBLIC__/template/default/img/acsuzhoulike/menu3.png">
                        <p style="color:#00b0fc">上传产品</p>
                    </a>
                </li>
                <li class="blend-imglist-item blend-imglist-small">
                    <a href="{:U('M/Acsuzhou/like_notice_app',array('mid' => $mid))}">
                        <img src="__PUBLIC__/template/default/img/acsuzhoulike/menu4-f.png">
                        <p>活动说明</p>
                    </a>
                </li>
            </ul>
        </div>
    </div>
    
    
    

</div> 
    <div style=" height:11rem; "></div>
    <div class="blend-title">
        <span>上传待检测产品</span>
    </div>
    
    <div>
        <form action="__SELF__" method="post" id="myform" enctype="multipart/form-data">
       <div id="" class="blend-form" style="margin: 8px 0;">
           
            <div class="blend-formgroup">
                <label class="blend-formgroup-label">产品名称:</label>
                <input type="text" name="productname" id='productname' class="blend-formgroup-input" placeholder="填写产品名称">
            </div>
           <div class="blend-formgroup">
                <label class="blend-formgroup-label">上传照片:</label>
                <input type="file" accept="image/*" class="file_input" name="image" onchange="readFile(this)"/>
                <div id="upload_img_show">
                    
                </div>
            </div>
           <input type='hidden' name='mid' value="{$mid}" />
           


        </div>
       
       <div style='  text-align: center; padding-top: 2rem;'>
           <button id='submit_btn' type='button' class="blend-button blend-button-primary blend-button-large" >提交</button>
          
           <button id='reset_btn' type='button' class="blend-button blend-button-primary blend-button-large" >重填</button>
       </div>
   </form>
    </div>
    <script>
       $(function(){
           
//           点击提交的按钮，需要提示，post提交信息

          $("#submit_btn").on("click",function(){
              
              var productname = $("#productname").val();
              if(productname=="" || typeof(productname)=="undefined")
                {
                    alert("请填写名字");
                    return false;
                }
                else
                {
                    $("#myform").submit();
                }
                
              
            
          });
          
          
          /*
           * 重填
           */
          $("#reset_btn").click(function(){
              window.location.reload();
          });
       });
        
        
        function readFile(obj){ 
            
            if(window.FileReader) {
                var file = obj.files[0]; 	
                //判断类型是不是图片
                if(!/image\/\w+/.test(file.type)){   
                        alert("请确保文件为图像类型"); 
                        return false; 
                } 
                var reader = new FileReader(); 
                reader.readAsDataURL(file); 
                reader.onload = function(e){ 
                        sessionStorage.setItem("upload_img",this.result);
                        sessionStorage.setItem("upload_img_type",file.type);

                        $("#upload_img_show").html('<img src="'+this.result+'" style="width:46px; height:46px; margin:1rem;"/>');
                        
//                        隐藏上传按钮
                        $(".file_input").hide();

                } 
                
            }
            else
            {
                alert("不支持");
            }
            
    } 
        </script>

<?php require_once 'cs.php';echo '<img src="'._cnzzTrackPageView(1256622573).'" width="0" height="0"/>';?>
<include file="Index/foot_analyze"/>
</body>
</html>